/*
 * 基金常用方法
 * @hopesoft
 * @20080721
 */
package cn.com.jrj.base.util;

public class FundTypeUtil {

	/*
	 * 基金类型列表
	 */
	public enum FundTypeList
	{
		//开放式基金,股票型基金,混合型基金,债券型基金,货币型基金,QDII,LOF,ETF,创新型基金,封闭式基金
		Open,Stock,Mixed,Bond,Currency,QDII,LOF,ETF,NewType,Close
	}	
		
	/*
	 * 获取基金类型对应SQL
	 */
	public static String getSQL(FundTypeList fundType)
	{
		String strSql="";		
		//开放型基金
		if(fundType==FundTypeList.Open)	
			strSql=" and F3_A051 in (2,4,5,8) and F51_A051<>'货币型' ";
		//股票型基金
		else if(fundType==FundTypeList.Stock)
			strSql=" and F3_A051 in (2,4,5,8) and F51_A051='股票型' ";
		//混合基金
		else if(fundType==FundTypeList.Mixed)
			strSql=" and F3_A051 in (2,4,5,8) and F51_A051='混合型' ";
		//债券型基金
		else if(fundType==FundTypeList.Bond)
			strSql=" and F3_A051 in (2,4,5,8) and F51_A051='债券型' ";
		//货币型基金
		else if(fundType==FundTypeList.Currency) 
			strSql=" and F51_A051 = '货币型' ";
		//QDII基金
		else if(fundType==FundTypeList.QDII)
			strSql=" and F115_A051=1 and F3_A051 in (8) ";
		//LOF基金
		else if(fundType==FundTypeList.LOF)
			strSql=" and F3_A051=4 ";
		//ETF基金
		else if(fundType==FundTypeList.ETF)
			strSql=" and F3_A051=5 ";
		//创新型基金
		else if(fundType==FundTypeList.NewType)
			strSql=" and F3_A051 in (6,7) ";
		//封闭式基金
		else if(fundType==FundTypeList.Close)
			strSql=" and F3_A051 in (1) ";
		return strSql;		
	}
	
	
}
